class Crc:
    table = [
        0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,
        0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef
    ]

    @staticmethod
    def calc(info, info_len):
        crc = 0 # 2btyes
        index = 0
        print('info_len', info_len)
        for i in range(info_len):
            da = (crc % 0xffff)>> 12
            crc <<= 4
            index = (int(info[i]/16)^da) % 0xff
            crc ^= Crc.table[index]
            da = (crc % 0xffff) >> 12
            crc <<= 4
            index = (da^int(info[i]&0xf)) % 0xff
            crc ^= Crc.table[index]

        return crc % 0xffff;    